package com.chenzhe.apipost;

import com.alibaba.fastjson.JSON;
import com.chenzhe.apipost.util.SendDataUtil;
import com.chenzhe.apipost.util.base64.Base64 ;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

public class SendDataMain {
    public static  String  privateKey = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAKgbeJOnKbicVLQIc/0H+jkoWr3Yig0woEyxTSC0eTgRSmzu1/zFgng15mvzascV50H/clqYWlUbaW2+8LjhYCMWd2GHs4MoXaoNAVUL5Y2tXK8wyfsKs8fJNmDFsMvkVsARlK4ZOF+9u8GaE5f/qZemiVBL4GDU4C4CG7XDxV/NAgMBAAECgYEAga63hMg28jh/S2cd+zu1N3S/E6dBUE2Ly74XLryqqqsEDCbwrgm7zXpfKDXe0HhAL3SdRfAz92WvHj9nOmh6nTAeWJQsctiXMcFJ52Es3VzyTwZSr/0yaWUNUC8fvPwXh80LFiwULxfXBnqoB2LXxAxhpHAXUS/TYnkS1qCXGuECQQD+JYI5XSw6JL1sQ9E/Ur6trRxkcBJSLRyHb8qnzfFva8RF6FfswxRdeggOB/PRDdMjMLGgd9yVZWrpS3wfl2l1AkEAqVVTwstvXgQhK5sf5ix7FfzQSEDxqJvxdMr6+zS8c2LW3nWt2p5dRpLXh7qNggkSJGpfqNo2i+LgzsmDKZn5+QJBALz7bUt0sjeGLGj+QPHCeNGywUMaZzU+IFHB2kNPi7Hbw/Zr4D3JjjI4VRcB6NbSXed0BRGbL6bT5F0YaXMgZyUCQGvSOy1z4AvbUUu00ND9Tbqoae83+yhDc7HMdZdy8vP94ZdxEyx7XiVL5xUzwlskb3rkiNi5abYU1tSVF4Fr2/ECQQCXoLmiNR81L1C24OgzWStgc/nX5eZUj2FTTXtRpheYGHHQ3ifSusP912OW7NdLQ6X4LJ7nLUcUcUZqycpTMPyM";
    public  static String publicKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCoG3iTpym4nFS0CHP9B/o5KFq92IoNMKBMsU0gtHk4EUps7tf8xYJ4NeZr82rHFedB/3JamFpVG2ltvvC44WAjFndhh7ODKF2qDQFVC+WNrVyvMMn7CrPHyTZgxbDL5FbAEZSuGThfvbvBmhOX/6mXpolQS+Bg1OAuAhu1w8VfzQIDAQAB";
    public static void main(String[] args) throws Exception {
        User user = new User("小明",12,"1333333333");
        String s2 = JSON.toJSONString(user);
        System.out.println(s2+"   被加密明文");
        Map map = new HashMap();
        map.put("a","1");
        map.put("b","2");

        String s3 = SendDataUtil.sendDataToYingDa(map,s2,privateKey);
        System.out.println(s3);


    }


}
